//
// Created by 12992 on 25-2-6.
//

// You may need to build the project (run Qt uic code generator) to get "ui_WatermarkWindow.h" resolved

#include "watermarkwindow.h"
#include "ui_WatermarkWindow.h"

#include <QScreen>

WatermarkWindow::WatermarkWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::WatermarkWindow) {
    ui->setupUi(this);
    this->initWindow();
}

WatermarkWindow::~WatermarkWindow() {
    delete ui;
}

void WatermarkWindow::initWindow() {
    // 初始化窗口属性的标记
    // 去除边框、不在任务栏上显示、在最顶层
    this->setWindowFlags(Qt::FramelessWindowHint | Qt::ToolTip | Qt::WindowStaysOnTopHint);
    // 透明背景
    this->setAttribute(Qt::WA_TranslucentBackground);
    // 删除小三角
    this->statusBar()->setSizeGripEnabled(false);
    // 固定大小
    this->setFixedSize(270, 100);
    // 移动位置
    auto *screen = QGuiApplication::primaryScreen();
    size_t y = screen->geometry().height() * 0.8;
    size_t x = screen->geometry().width() * 0.8;
    this->move(x,y);
    this->statusBar()->hide();
}
